<?php
/**
 * Created by PhpStorm.
 * User: THINK
 * Date: 2017/8/31
 * Time: 14:44
 */

namespace Admin\Controller;


use Think\Controller;
use Org\Util\Rbac;
class BaseController extends Controller
{
    public function _initialize(){

        if(!isset($_SESSION[C('USER_AUTH_KEY')])){//是否拥有用户识别号
            $this->redirect("User/login");
        }
        if(C('USER_AUTH_ON')){//判断是否需要认证
            Rbac::AccessDecision()||$this->error('没有权限');
        }

    }
}